#include "common.h"

#include <stdlib.h>
#include <time.h>
#include "SettingsManager.h"

int commonRand(int max){
	static int isInit = 0;
	time_t graine;

	if(!isInit){
		if(smIsTest())
			graine = smGetGraine();
		else
			graine = time(NULL);
		srand(graine);
		isInit = 1;
	}
	
	return rand()%max;
}

